using System;
using System.Net;

namespace NetDns
{
	/// <summary>
	/// ANAME Resource Record (RR) (RFC1035 3.4.1)
	/// </summary>
	public class Aaaa : IRecord
	{
		// An AAAA record consists simply of an 16 bytes array indicating an IP Address
		internal IPAddress ipAddress;

		// expose this IP address r/o to the world
		public IPAddress IPAddress
		{
			get { return ipAddress; }
		}

		/// <summary>
		/// Constructs an AAAA record by reading bytes from a return message
		/// </summary>
		/// <param name="pointer">A logical pointer to the bytes holding the record</param>
		internal Aaaa(Pointer pointer)
		{
			byte[] b = pointer.ReadBytes(16);
			ipAddress = new IPAddress(b);
		}

		public override string ToString()
		{
			return ipAddress.ToString();
		}
	}
}
